<?php
/**
 * @author GhostWei
 * @date 2012-7-16
 */
class controller_www_search extends picture_front_controller {	
	
	public function action_index() {
		$keyword = trim($this->_get('keyword'));
		if($keyword == self::$keyword) {
			$keyword = '';
		}

		$adapter = new system_paginator_adapter_concept(new picture_special_concept($this->_lang()));
		$adapter->setCurrentPageNumber(intval($this->_param('page', 1)));
		$adapter->where("special.is_active = 1");
		if($keyword) {
			$adapter->where("locale.title LIKE ?", "%$keyword%");
		}
		$adapter->setLimit(48);
		$adapter->order(array("special.display_order DESC"));
		$this->view->specialList = new system_paginator($adapter);
		$this->_crumbs()->addPage(system_nav_page::create($this->language('搜索') . ':' . $keyword)->setRoute('index/index'));
		$this->render();
	}
	
}
